home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
Other Langs
/
Tickle-4.0 (tcl)
/
src
/
xcmd.a
< prev
next >
Wrap
Text File
|
1993-11-18
|
2KB
|
95 lines
;;
;; This source code was written by Tim Endres
;; Email: time@ice.com.
;; USMail: 8840 Main Street, Whitmore Lake, MI 48189
;;
;; Some portions of this application utilize sources
;; that are copyrighted by ICE Engineering, Inc., and
;; ICE Engineering retains all rights to those sources.
;;
;; Neither ICE Engineering, Inc., nor Tim Endres,
;; warrants this source code for any reason, and neither
;; party assumes any responsbility for the use of these
;; sources, libraries, or applications. The user of these
;; sources and binaries assumes all responsbilities for
;; any resulting consequences.
;;
INCLUDE 'Traps.a'
CASE OBJECT
;
; void CallXTCL(argc, argv, xpb, proc_ptr)
; int argc;
; char *argv[];
; XTCLParmBlk *xpb;
; ProcPtr proc_ptr;
;
;
;CallXTCL PROC EXPORT
;
; ; DC.W $A9FF
;
; MOVEM.L A0, -(A7) ; Save registers
;
; MOVEA.L $10(A7), A0 ; Get Command Block Pointer
; MOVE.L A0, -(A7) ; Push Command Block Pointer
; MOVEA.L $10(A7), A0 ; Get argv
; MOVE.L A0, -(A7) ; Push argv
; MOVEA.L $10(A7), A0 ; Get argc
; MOVE.L A0, -(A7) ; Push argc
; MOVEA.L $20(A7), A0 ; Get Procedure Pointer (pushed up 12!)
;
; JSR (A0) ; Call pascal XTCL routine.
; ADDA.W #$0C, A7 ; C procedures do NOT remove their paramaters...
;
; MOVEM.L (A7)+, A0 ; Restore registers;
;
; ; No return result...
;
; RTS
;
;
; pascal int XTCLCallBack(cpb, script_handle, result_handle, stdout_handle)
; int argc;
; char *argv[];
; XTCLParmBlk *xpb;
;
;
CASE OFF ; Pascal names!!!
XTCLCallBack PROC EXPORT
; DC.W $A9FF
MOVEM.L A0, -(A7) ; Save registers
; XTCL_Eval_CallBack(cpb, script_handle, result_handle, stdout_handle)
MOVEA.L $8(A7), A0 ; Get stdout_handle
MOVE.L A0, -(A7) ; Push stdout_handle
MOVEA.L $10(A7), A0 ; Get result_handle
MOVE.L A0, -(A7) ; Push result_handle
MOVEA.L $18(A7), A0 ; Get script_handle
MOVE.L A0, -(A7) ; Push script_handle
MOVEA.L $20(A7), A0 ; Get cpb
MOVE.L A0, -(A7) ; Push cpb
MOVEA.L $16(A0), A0 ; Get Procedure Pointer (22 bytes from structure start)
JSR (A0) ; Call C callback routine.
ADDA.W #$10, A7 ; C procedures DO NOT remove their paramaters...
MOVE.L D0, $18(A7) ; Get return value.
MOVEM.L (A7)+, A0 ; Restore registers
RTS
CASE OBJECT
END